home *** CD-ROM | disk | FTP | other *** search
- /* some definitions for the brwsr program...
- * 870805-07-... ^z
- */
-
- /* tell the compiler that we are using Lightspeed C ... mostly so that
- * certain sections of non-transportable code will be activated to
- * compensate for the use of 16-bit int variables in LSC.... */
- #define LIGHTSPEED
-
- /* KEY_LENGTH is the number of letters we have in each record.... must
- * agree with the value used in qndxr to build the index!.... */
- #define KEY_LENGTH 28
-
- /* CONTEXT_LINE_LENGTH is the total length of a key-word-in-context
- * display line.... */
- #define CONTEXT_LINE_LENGTH 75
-
- /* CONTEXT_OFFSET is the distance from the start of the context line
- * to where the key word itself begins.... */
- #define CONTEXT_OFFSET 30
-
- /* STRLEN is the most characters to allow in a line from the
- * file at one time, and the maximum length of a command line.... */
- #define STRLEN 256
-
- /* NEIGHBORHOOD is the distance in bytes that defines the proximity
- * neighborhood of a word in the index ... used when defining a
- * subset for proximity searching.... NEIGHBORHOOD * 8 is the
- * compression factor for squeezing the document file down into the
- * array subset[] ...
- * Thus, NEIGHBORHOOD = 32, a good choice, defines a chunkiness of 32
- * characters in making comparisons for proximity determination purposes....
- */
- #define NEIGHBORHOOD 32
-
- /* WORD_RANGE, SENTENCE_RANGE, and PARAGRAPH_RANGE define how many chunks
- * of size NEIGHBORHOOD on each side of an item that the neighborhood of
- * each type extends. Values 1, 10, and 100 work pretty well....
- */
- #define WORD_RANGE 1
- #define SENTENCE_RANGE 10
- #define PARAGRAPH_RANGE 100
-
- /* define a value to help recognize long operations, for which
- * the user should be warned of a likely delay in response ...
- */
- #define GIVE_WARNING 200
-
- /* structure of the records in the index key file:
- * a fixed-length character string kkey, filled out with blanks and
- * containing the unique alphanumeric 'words' in the document file,
- * changed to all-capital letters;
- * a cumulative count of how many total occurrences of words, including
- * the current one, have happened up to this point in the alphabetized
- * index.
- *
- * Obviously, the number of occurrences of the nth word is just the
- * difference between the nth cumulative count and the (n-1)th
- * cumulative count. Also, the (n-1)th cumulative count is a
- * pointer to the first occurrence of the nth word in the ptr_file
- * (which holds all the index offset pointers for the document file).
- *
- * See the index building program "ndxr.c" for further details of the
- * index structure....
- */
- typedef struct
- {
- char kkey[KEY_LENGTH];
- long ccount;
- } KEY_REC;
-
- /* the pointer records are simply long integers, offsets from the start
- * of the document to the indexed words....*/
- #define PTR_REC long
-
- /* define the values for the three levels that the user may be browsing
- * on: INDEX is the display of unique words and their occurrence counts;
- * CONTEXT is the key-word-in-context (KWIC) display; TEXT is the full
- * text of the document. */
- #define INDEX 0
- #define CONTEXT 1
- #define TEXT 2
-
- /* symbolic values for yes/no answers... */
- #define TRUE 1
- #define FALSE 0
-